import request from '@/utils/request'

export default {
  getDeviceList (data) {
    const url = 'main/equipment/list'
    return request.get(url, data)
  },
  deleteDevice (data) {
    const url = 'main/equipment' + '/' + data
    return request.delete(url)
  },
  addDevice (data) {
    const url = 'main/equipment'
    return request.postJson(url, data)
  },
  updateDevice (data) {
    const url = 'main/equipment'
    return request.putJson(url, data)
  },
  getDeviceDetail (data) {
    const url = 'main/equipment/model'
    return request.get(url, data)
  },
  getDeptTree () {
    const url = 'system/dept'
    return request.get(url)
  },
  getGridTree () {
    const url = 'main/grid/tree'
    return request.get(url)
  },
  getDictValueAttr (data) {
    const url = 'system/dict/getDictValueAttr'
    return request.get(url, data)
  },
  getDictValueList (data) {
    const url = 'system/dictValue/list'
    return request.get(url, data)
  },
  getDictValueListById (data) {
    const url = 'system/dictValue/dictlist/' + data.dictId
    return request.get(url)
  },
  //
  deleteDictValue (data) {
    const url = 'system/dictValue/batchDeleteByIds' + '/' + data
    return request.delete(url)
  },
  addDictValue (data) {
    const url = 'system/dictValue'
    return request.post(url, data)
  },
  // 设备解绑
  unbind (data) {
    const url = 'main/equipment/unbind/grid'
    return request.postBody(url, data)
  },
  addGridDevice (data) {
    const url = 'main/equipment/update/grid'
    return request.postBody(url, data)
  },
  updateDictValue (data) {
    const url = 'system/dictValue'
    return request.put(url, data)
  },
  getSurveySmokeList (data) {
    const url = 'main/survey/list'
    return request.get(url, data)
  },
  getSurveySmokeDetail (data) {
    const url = 'main/survey/model'
    return request.get(url, data)
  },
  getEquipmentCameraList (data) {
    const url = 'console/equipmentCamera/list'
    return request.get(url, data)
  },
  deleteEquipmentCamera (data) {
    const url = 'console/equipmentCamera/batchDeleteByIds' + '/' + data
    return request.delete(url)
  },
  // console/equipmentCamera
  addEquipmentCamera (data) {
    const url = 'console/equipmentCamera'
    return request.post(url, data)
  },
  updateEquipmentCamera (data) {
    const url = 'console/equipmentCamera'
    return request.put(url, data)
  },


  getCameraBindEquipment (data) {
    const url = 'console/equipmentCameraBind/queryList'
    return request.get(url, data)
  },

  addCameraBindEquipment (data) {
    const url = 'console/equipmentCameraBind/addBind'
    return request.postJson(url, data)
  },

  selectEquipmentByCamera (data) {
    const url = 'main/equipment/selectEquipmentByCamera'
    return request.get(url, data)
  },


  getEquipmentAll () {
    const url = 'main/equipment/all'
    return request.get(url)
  },

  dealTrigger (data) {
    const url = 'main/equipmentLinkageTrigger/dealTrigger'
    return request.postJson(url, data)
  },

  getTriggerInfo (data) {
    const url = 'main/equipmentLinkageAction/queryList'
    return request.get(url, data)
  },

  deleteTrigger (data) {
    const url = 'main/equipmentLinkageTrigger/deleteTrigger'
    return request.delete(url, data)
  },
  updateTrigger (data) {
    const url = 'main/equipmentLinkageTrigger/updateTrigger'
    return request.putJson(url, data)
  },

  getTriggerList (data) {
    const url = 'main/equipmentLinkageTrigger/queryPage'
    return request.get(url, data)
  },
  getGateway (data) {
    const url = 'console/tEquipmentGateway/queryPage'
    return request.get(url, data)
  },
  dealEquipmentGateWay (data) {
    const url = 'console/tEquipmentGateway/dealEquipmentGateWay'
    return request.postJson(url, data)
  },
  deleteGateway (id) {
    const url = 'console/tEquipmentGateway/deleteGateway?id=' + id
    return request.delete(url)
  },
  // 编码规则
  getEquipmentCodeRule (data) {
    const url = 'main/tEquipmentCodeRule/queryPage'
    return request.get(url, data)
  },
  addEquipmentCodeRule (data) {
    const url = 'main/tEquipmentCodeRule'
    return request.postJson(url, data)
  },
  updateEquipmentCodeRule (data) {
    const url = 'main/tEquipmentCodeRule'
    return request.putJson(url, data)
  },
  deleteEquipmentCodeRule (id) {
    const url = 'main/tEquipmentCodeRule?id=' + id
    return request.delete(url)
  },

  getEquipmentCodeRuleFindById (data) {
    const url = 'main/tEquipmentCodeRule/findById'
    return request.get(url, data)
  },
  getEquipmentCodeRuleInfo (data) {
    const url = 'main/tEquipmentCodeRule/queryInfo'
    return request.postJson(url, data)
  },
}
